package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.system.annotation.UserContext;
import com.ruoyi.system.domain.vo.UserData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TbMerchantCustomerChatRecordMapper;
import com.ruoyi.system.domain.TbMerchantCustomerChatRecord;
import com.ruoyi.system.service.ITbMerchantCustomerChatRecordService;

/**
 * 聊天记录管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-09-12
 */
@Service
public class TbMerchantCustomerChatRecordServiceImpl implements ITbMerchantCustomerChatRecordService 
{
    @Autowired
    private TbMerchantCustomerChatRecordMapper tbMerchantCustomerChatRecordMapper;

    /**
     * 查询聊天记录管理
     * 
     * @param recordId 聊天记录管理主键
     * @return 聊天记录管理
     */
    @Override
    public TbMerchantCustomerChatRecord selectTbMerchantCustomerChatRecordByRecordId(Long recordId)
    {
        return tbMerchantCustomerChatRecordMapper.selectTbMerchantCustomerChatRecordByRecordId(recordId);
    }

    /**
     * 查询聊天记录管理列表
     * 
     * @param tbMerchantCustomerChatRecord 聊天记录管理
     * @return 聊天记录管理
     */
    @Override
    public List<TbMerchantCustomerChatRecord> selectTbMerchantCustomerChatRecordList(TbMerchantCustomerChatRecord tbMerchantCustomerChatRecord)
    {
        UserData userData = UserContext.getUserData();
        tbMerchantCustomerChatRecord.setMerchantId((long)userData.getMerchantId());
        tbMerchantCustomerChatRecord.setStoreId((long)userData.getStoreId());
        return tbMerchantCustomerChatRecordMapper.selectTbMerchantCustomerChatRecordList(tbMerchantCustomerChatRecord);

    }

    /**
     * 新增聊天记录管理
     * 
     * @param tbMerchantCustomerChatRecord 聊天记录管理
     * @return 结果
     */
    @Override
    public int insertTbMerchantCustomerChatRecord(TbMerchantCustomerChatRecord tbMerchantCustomerChatRecord)
    {
        return tbMerchantCustomerChatRecordMapper.insertTbMerchantCustomerChatRecord(tbMerchantCustomerChatRecord);
    }

    /**
     * 修改聊天记录管理
     * 
     * @param tbMerchantCustomerChatRecord 聊天记录管理
     * @return 结果
     */
    @Override
    public int updateTbMerchantCustomerChatRecord(TbMerchantCustomerChatRecord tbMerchantCustomerChatRecord)
    {
        return tbMerchantCustomerChatRecordMapper.updateTbMerchantCustomerChatRecord(tbMerchantCustomerChatRecord);
    }

    /**
     * 批量删除聊天记录管理
     * 
     * @param recordIds 需要删除的聊天记录管理主键
     * @return 结果
     */
    @Override
    public int deleteTbMerchantCustomerChatRecordByRecordIds(Long[] recordIds)
    {
        return tbMerchantCustomerChatRecordMapper.deleteTbMerchantCustomerChatRecordByRecordIds(recordIds);
    }

    /**
     * 删除聊天记录管理信息
     * 
     * @param recordId 聊天记录管理主键
     * @return 结果
     */
    @Override
    public int deleteTbMerchantCustomerChatRecordByRecordId(Long recordId)
    {
        return tbMerchantCustomerChatRecordMapper.deleteTbMerchantCustomerChatRecordByRecordId(recordId);
    }
}
